package com.sayyi.demo.micro.storage.api;

import com.sayyi.demo.micro.storage.domain.UpdateStorageRequest;

public interface StorageApi {

    /**
     * 扣减商品库存
     * @param updateStorageRequest
     * @return
     */
    boolean updateStorage(UpdateStorageRequest updateStorageRequest);

    /**
     * 库存补偿
     * @param updateStorageRequest
     * @return
     */
    boolean compensateStorage(UpdateStorageRequest updateStorageRequest);

    /**
     * 通过TCC来处理分布式事务
     * @param updateStorageRequest
     * @return
     */
    boolean updateByTcc(UpdateStorageRequest updateStorageRequest);
}
